import java.util.Scanner;
    public class Test {
        public static void main(String[] args) {
            int n=3;
            hanio(n-2,'A','B','C');
            System.out.println();
            hanio(n-1,'A','B','C');
            System.out.println();
            hanio(n,'A','B','C');
        }
        public static void hanio(int n,char pos1,char pos2,char pos3){
            if(n==1){
              prints(pos1,pos3);
            }else{
                hanio(n-1,pos1,pos3,pos2);
                prints(pos1,pos3);
                hanio(n-1,pos2,pos1,pos3);
            }
        }
        public static void prints(char pos1,char pos2){
            System.out.print(pos1+"->"+pos2+"  ");
        }

        public static void main4(String[] args) {
            int a=520,b=1314;
            double d=13.14,e=5.20,f=13.520;
            System.out.println(max(a,b));
            System.out.println(max(d,e,f));
        }
        public static int max(int a,int b){
            return a>b?a:b;
        }
        public static double max(double a,double b,double c){
            double max=a>b?a:b;
            max=max>c?max:c;
            return max;
        }







        public static void main3(String[] args) {
            int a=10,b=20;
            double d=3.14,e=4.11,f=5.2;
            System.out.println(add(a,b));
            System.out.println(add(d,e,f));
        }
        public static int add(int a,int b){
            return a+b;
        }
        public static double add(double a,double b,double c){
            return a+b+c;
        }






        public static void main2(String[] args) {
        int f1=1;
        int f2=1;
        int sum=0;
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        if(n<=2){
            System.out.println(1);
        }else{
            for(int i=3;i<=n;i++){
                sum=f1+f2;
                f1=f2;
                f2=sum;
            }
            System.out.println(sum);
        }
    }
}


